package club.bayuan.queue;


public class QueueTest extends LinkedList implements Queue {

    LinkedList linkedList;

    public QueueTest() {
        linkedList = new LinkedList();
    }

    @Override
    public void add(Object o) {
        linkedList.addNote(o);
    }

    @Override
    public Object delete() {
        if (!linkedList.linkedListIsEmpty()) {
            return linkedList.remove(0);
        }
        return null;
    }


    @Override
    public boolean isEmpty() {
        return linkedList.linkedListIsEmpty();
    }

    public static void main(String[] args) {

        Queue queue = new QueueTest();
        queue.add(1);
        queue.add(2);
        queue.add(3);
        queue.add(4);

        System.out.println(queue.isEmpty());

        System.out.println(queue.delete());
        System.out.println(queue.delete());
        System.out.println(queue.delete());
        System.out.println(queue.delete());

        System.out.println(queue.isEmpty());

    }


}
